function reg(){
    let img = null;
    let imgs = document.getElementsByName('avatar');
    console.log(imgs)
    for (let i = 0; i < imgs.length; i++) {
        if (imgs[i].checked) {
            img = imgs[i]
        }
        
    }
    axios.get("/user/reg",{
        params:{
            username: $('username').value,
            pwd: $('password').value,
            repeatPwd: $('confirmPwd').value,
            email: $('email').value,
            imgPath: img.value
            
        }
    }).then(resp=>{
        if (resp.data == "ok") {
            window.location.href = "login.html";
        }
        else{
            alert(resp.data)
        }
    })
}

function reset(){
    $('username').value = '';
    $('password').value = '';
    $('confirmPwd').value = '';
    $('email').value = '';    
}